package com.rocky.component.elasticsearch.model;

import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.time.ZoneOffset;

/**
 * @author rocky
 * date 2025-08-16
 * Description:
 */
@Data
@Accessors(chain = true)
public class RockyDocumentWrapper {

    private String id;

    private Long version;

    private Object body;

    public RockyDocumentWrapper setVersion(Long version) {
        this.version = version;
        return this;
    }

    public RockyDocumentWrapper setVersion(LocalDateTime localDateTime) {
        this.version = localDateTime.toEpochSecond(ZoneOffset.of("+8"));
        return this;
    }
}
